import 'package:flutter/material.dart';

import '../../../../helper/utils/util.dart';
import 'index.dart';
import 'widgets/widgets.dart';

class UsuallyViewDemoPage extends GetView<UsuallyViewDemoController> {
  const UsuallyViewDemoPage({Key? key}) : super(key: key);

  // 主视图
  Widget _buildView() {
    return ListView(
      children: [
        Container(
          height: 30,
          alignment: Alignment.centerLeft,
          color: Colors.red,
          child: TextField(
            scrollPadding: EdgeInsets.zero,
            decoration: InputDecoration(
                contentPadding: EdgeInsets.zero,
                isCollapsed: true,
                fillColor: Colors.amber,
                filled: true,
                hintText: '请输入'),
          ),
        ),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<UsuallyViewDemoController>(
      builder: (_) {
        return Scaffold(
          appBar: AppBar(title: const Text("常用组件")),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
